﻿using Business;
using LMS.Models.Partial;

namespace LMS.App_Start
{
    public static class CacheServer
    {
        public static LeftModel leftModelCache { get; set; }

        public static void CacheMainData()
        {
            if (leftModelCache == null)
            {
                var channelHelper = new ChannelBC();
                
                var channelList = channelHelper.GetChannelsMenu();
                
                LeftModel leftModel = new LeftModel { ChannelList = channelList };
                leftModelCache = leftModel;
                channelHelper = null;
            }
        }

        public static void ClearCache()
        {
            leftModelCache = null;
        }
    }
}